home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / CMOSRAM.ARJ / CMOS_RAM.DOC < prev    next >
Text File  |  1991-07-24  |  16KB  |  246 lines

  1.      CMOS_RAM.EXE:                                                       
  2.  
  3.     I. INTRODUCTION 
  4.          Inside (almost) each and every one of the 47.2 billion IBM AT 
  5.     clones sold daily there lives an elegant solution to the problem of 
  6.     configuring a flexible yet easy to use computer system: the internal 
  7.     CMOS configuration RAM. 
  8.          When IBM designed the AT they listened to their customer's 
  9.     grumblings enough to know that one of the major stumbling blocks for 
  10.     the average PC and XT user was figuring out how to set the motherboard 
  11.     DIP switches.  Business users also complained about not having a built 
  12.     in real time clock.  (I guess the sales racked up by companies like AST 
  13.     on their multifunction boards with clocks didn't hurt any either!)  So 
  14.     now all AT's also have battery backed up clocks.  IBM solved both 
  15.     problems with one IC - a clock calendar chip made by Motorola 
  16.     (MC146818) which includes 50 bytes of user addressable non volatile 
  17.     RAM.  This same chip is also used by many clone makers, but other 
  18.     configurations which perform identically are possible.  
  19.          So now, instead of flipping DIP switches to configure your 
  20.     computer, the AT uses software to store the machine's configuration.  
  21.     This software takes the form of a setup program provided by the BIOS 
  22.     manufacturer, either resident in the BIOS ROM or in a disk based 
  23.     utility called (you guessed it) SETUP.  True Blue IBM users will find 
  24.     it on their Advanced Diagnostics Diskette.  The idea is that with this 
  25.     program, you can quickly install or remove equipment from the computer 
  26.     without having to search for the documentation.  In reality, the 
  27.     success of this approach depends on the quality of the software.  Most 
  28.     of the programs I've seen are pretty bare bones, but passable. 
  29.          And what kind of information is stored in this ROM?  Quoting from 
  30.     IBM's Personal Computer AT Technical Reference Manual - an excellent 
  31.     way for those who feel their bank account is $125 too heavy to correct 
  32.     the situation - the following information is stored in the CMOS ROM: 
  33.          1. Clock information 
  34.          2. Diagnostics status byte 
  35.          3. Shutdown status byte 
  36.          3. Diskette drive type byte - drives A and B 
  37.          4. Fixed disk drive byte - drives C and D 
  38.          5. Equipment byte (# of diskette drives, display adapter and math 
  39.          coprocessor) 
  40.          6. Low and high base memory bytes 
  41.          7. Low and high expansion memory bytes 
  42.          8. A checksum byte to confirm the validity of the stored data 
  43.          In addition, there are several bytes of memory whose use IBM does 
  44.     not specify, but instead marks them as reserved.  Perhaps they are 
  45.     there to allow DOS to smash the 640K barrier with an additional 3 bytes 
  46.     of slow memory. 
  47.     
  48.     II. THE SNAG 
  49.          Well, this all sounds very nice and possibly even remotely 
  50.     interesting but probably fits in the same category as general 
  51.     relativity theory: Interesting But Of Little Use In Everyday Life (move 
  52.     over, Albert).  Ah, but here's the rub: much like the IRS, it can cause 
  53.     you grief without warning. 
  54.          Think about it: what's been the problem with every battery 
  55.     operated toy you've ever had?  That's right, (unless you broke it 
  56.     first) eventually the batteries died!  And there's little more useless 
  57.     than a toy with dead batteries - including your AT. 
  58.          How long can you expect the battery life to be?  It's difficult to 
  59.     say; many different battery types are in use.  However, two kinds 
  60.     dominate the marketplace:  the lithium cell and the alkaline battery 
  61.     pack.  (A few manufacturers use a rechargeable NICAD pack and claim 
  62.     infinite life.  If you buy one of these, write to the manufacturer and 
  63.     demand complete test results.)  The batteries are being used at a very 
  64.     low current drain, so their lifetime is essentially equal to what the 
  65.     manufacturer calls the shelf life.  This number varies widely, but 2 to 
  66.     3 years is probably a typical number.  Your mileage may vary. 
  67.          What would the symptoms of a dead battery be?  Again, it varies 
  68.     among BIOS manufacturers, but most of them do a check of the CMOS RAM 
  69.     at power up.  If the check bounces, the boot process will generally 
  70.     halt with an error message.  BIOS's with disk based setup programs will 
  71.     then assume some kind of default state, usually a lowest common 
  72.     denominator type of setup with 512K of RAM and 1 floppy drive; those 
  73.     with internal setup programs often just halt.  Now you have to 
  74.     recognize that this machine - which worked fine yesterday but is now 
  75.     mysteriously broken - only needs a new battery to be back on it's feet.  
  76.     Otherwise, you're in for an expensive service call and some downtime. 
  77.          Oh yes, it does need one other thing - it needs to be 
  78.     reconfigured!  I hope you remember how many cylinders and heads your 
  79.     hard disk has...  Well, it should be in the documentation - if only you 
  80.     could find it.  And the diskette with the SETUP program?!  Or maybe you 
  81.     don't really know that much about computers so the dealer you bought it 
  82.     from configured it for you and maybe THAT GUY WENT OUT OF BUSINESS 2 
  83.     YEARS AGO 'cause you bootlegged LOTus and WordPerfect from your brother 
  84.     in law and maybe YOU DON'T EVEN KNOW WHAT KIND OF DISK DRIVES ARE IN 
  85.     THE MACHINE and maybe YOU DON'T KNOW HOW TO SETUP YOUR MACHINE because 
  86.     you've NEVER DONE IT BEFORE...  Well, no time like the present to 
  87.     learn!  Will there be snags the first time you try it?  Of course there 
  88.     will be!  Will there be a crucial job whose deadline comes and goes 
  89.     while you pore over reams of documentation as the rest of the free 
  90.     world sleeps soundly?  Of course there will be!  
  91.          A gloomy picture isn't it?  But don't worry, be happy, now there's 
  92.     
  93.     III.  HOPE FOR THE DAMNED: CMOS_RAM.EXE 
  94.          CMOS_RAM.EXE is a program whose sole purpose in life is to 
  95.     minimize the pain of silicon senility, premature or otherwise.  How 
  96.     does it do that?  Simple!  By storing the contents of your CMOS RAM in 
  97.     a file while the computer is up and running, it can be quickly and 
  98.     easily restored when the unthinkable - but inevitable - occurs.  Here's 
  99.     how you do it: 
  100.          Make up what I call a "disaster" floppy.  This is a bootable 
  101.     floppy disk (consult your DOS manual or the little kid next door if you 
  102.     don't know how to do that) with AUTOEXEC.BAT and CONFIG.SYS files 
  103.     almost exactly the same as those which reside on your hard disk.  
  104.     However, since you could be using this disk when things are flaky, 
  105.     leave out most of the memory resident stuff - they might confuse the 
  106.     issue.  In addition, I'd include a copy of your hard disk restore 
  107.     program, a simple ASCII text editor, and something like PC TOOLS to 
  108.     allow you to play around trying to fix whatever the problem might be.  
  109.     Try booting from this floppy to ensure that you haven't forgotten 
  110.     anything. 
  111.          Oh, and one more thing should be included (flourish of trumpets): 
  112.     CMOS_RAM.EXE!  With the disaster floppy in the diskette drive, simply 
  113.     type cmos_ram, press return, and after a short but delightful 
  114.     introductory screen the program will present you with 5 choices: 
  115.          1: About the CMOS RAM 
  116.          2: Save the contents of your CMOS RAM to a disk file 
  117.          3: Restore the CMOS RAM from the disk file 
  118.          4: Set the CMOS clock 
  119.          5: Exit 
  120.          Pressing 1 brings up a series of help screens, which basically 
  121.     repeat the text in this document in a shorter and less witty fashion.  
  122.     Perhaps you will prefer this. 
  123.          Option 2 is the one you'll use first to save the CMOS RAM's 
  124.     contents.  As long as there is around 250 bytes of available space on 
  125.     the disk, a file called CMOS.RAM will be written and checked for validity.
  126.          The third option is the one employed to bring your system back 
  127.     from the dead.  As long as the program can find the CMOS.RAM data file 
  128.     in the current subdirectory, RAM restoration will take place very 
  129.     quickly (less than one second).  Everything should be copasetic now, 
  130.     except that the time will be set to whatever time it was when you saved 
  131.     the RAM.  No problem, that's what option 4 is for. 
  132.          Option 4 allows the setting of the clock to the current date and 
  133.     time.  This option does not affect the current DOS time, so the change 
  134.     will not take effect until you reboot.  You can use this option 
  135.     whenever you have to change the date or time, such as going on and off 
  136.     daylight savings time.  Curiously, although the MC146818 has a daylight 
  137.     savings time function, DOS does not use it.  It also has a day of the 
  138.     week function, but DOS works that out on it's own.  Go figure. 
  139.          One caveat: the routines I wrote for setting the time and date 
  140.     will work for any BIOS that follows the IBM guidelines.  I have tested 
  141.     the program on machines with Phoenix, Award, and AMI BIOS's, and it 
  142.     works on all of them.  However, it would be possible to design a 
  143.     hardware/software system for which this program would not work 
  144.     correctly.  However, it should not damage the system in any way. 
  145.          Do I have to explain the fifth option? 
  146.     
  147.     IV.  DEALING WITH DISASTER 
  148.          So it's finally happened - your AT won't boot up.  Does it give 
  149.     you a message relating to an invalid configuration, or anything else 
  150.     that makes you think it could be the CMOS RAM?  A typical example would be:
  151.  
  152.     Invalid configuration information - please run SETUP program Strike the 
  153.     F1 key to continue 
  154.          Your next move depends on your machine.  Units with ROM based 
  155.     setup programs usually won't proceed any further no matter what you do.  
  156.     You must press a key, or combination of keys, to enter the setup 
  157.     routine and configure the system to at least recognize the A: floppy 
  158.     drive.  Don't bother with the rest of the information; running CMOS_RAM 
  159.     as explained in the next paragraph will take care of that as long as 
  160.     the machine will boot. 
  161.          Computers with disk based SETUP programs have it easier.  These 
  162.     machines usually allow the A: floppy to work no matter what the 
  163.     contents of the CMOS RAM are, so just whip out your disaster floppy and 
  164.     run CMOS_RAM.  Select option 3, and then set the time and date with 
  165.     option 4.  If no error messages result, open the drive A: door and 
  166.     reboot the machine with CTRL-ALT-DEL.  You should be up and running 
  167.     that fast!  
  168.          But now you're faced with replacing the battery.  This means you 
  169.     or a technically oriented friend upon whom you can impose are going to 
  170.     have to open up the machine and get a replacement for the battery.  The 
  171.     more conservative among us might be well advised to make a hard disk 
  172.     backup before opening the machine.  If you just know how to use a 
  173.     screwdriver, and how to replace the batteries in a flashlight, you 
  174.     should be able to do the work yourself.  Computer hardware knowledge is 
  175.     usually not required.  A hint: most batteries are either stuck to the 
  176.     back wall of the computer in a holder or on the motherboard in a "coin 
  177.     cell" holder.  
  178.          However, in some cases it still may be worthwhile to take your 
  179.     computer to an authorized repair station.  An example of such a case 
  180.     would be if opening the computer required a tool you've never seen 
  181.     before, or if you really are just all thumbs with hardware.        
  182.     
  183.          A WORD OF WARNING: 
  184.          Do I really have to remind you to unplug the computer before 
  185.     opening the case?  Please do.  Also, never touch anything on a printed 
  186.     circuit board without touching a large metal object first.  This is not 
  187.     a good time to wear your knit sweaters... anything with "static cling" 
  188.     is a bad idea! 
  189.          If your machine uses 4 alkaline AA cells, you can just run to the 
  190.     corner convenience store and pick up replacements.  Be sure to get a 
  191.     reliable alkaline brand, such as Eveready, Duracell, Radio Shack, or 
  192.     Kodak.  Look for a good expiration date.  If the batteries simply slip 
  193.     into the holder, put a sturdy rubber band around the holder to hold 
  194.     them securely in case of rough handling.  
  195.          Those with lithium batteries are in for a little rougher time 
  196.     locating a replacement.  Luckily, our friends at Radio Shack have a 
  197.     rather nice selection of replacement batteries, including some which 
  198.     look as though they should do the job for most models.  If not, the 
  199.     Radio Shack catalog says they will special order any battery, although 
  200.     I don't know how good they are.  As a last resort, you may have to 
  201.     contact your manufacturer. 
  202.          ANOTHER WORD OF WARNING: 
  203.          NEVER EVER EVER carry a lithium battery loose in your pocket or in 
  204.     a purse.  When shorted - such as with coins or keys - lithium batteries 
  205.     are an explosion and burn hazard.  These cells pack a hefty wallop, and 
  206.     while current types have an over-pressure venting system DON'T TRY IT!  
  207.     Put the cell in an envelope, wrap tape around it, or figure out some 
  208.     other way to insulate it.  Leave the new cell in it's protective 
  209.     packaging until you're ready to use it.  Also, be sure to dispose of 
  210.     the old cell per the manufacturer's instructions. 
  211.          Another thought to share with you:  you can't ease the replacement 
  212.     process the next time by buying two sets of batteries and keeping one 
  213.     aside.  Since the battery's lifetime is essentially equal to it's shelf 
  214.     life, when the one in use quits the other will be at the end of it's 
  215.     life also.  Buy a fresh one. 
  216.          Once the battery is in place, go through the ritual outlined above 
  217.     one last time, and then you're back in business. 
  218.     
  219.     V. WAIT, THERE'S MORE 
  220.          Well, it seems that CMOS_RAM has made the world safe for truth, 
  221.     justice, and the American way.  By taking a few minutes to prepare 
  222.     before disaster strikes, I say BEFORE DISASTER STRIKES, a potentially 
  223.     expensive service call can be handled by anyone with a basic knowledge 
  224.     of tools and the inside of a computer. 
  225.          However, one problem with a program like CMOS_RAM is that it's 
  226.     easy to use it and forget about it.  After all, it could be several 
  227.     years until you need it.  In that time, you could easily change your 
  228.     hardware and forget to update CMOS.RAM, defeating the program's purpose 
  229.     and increasing your hassles. 
  230.          Enter CHEKCMOS.  Just install this program in your AUTOEXEC.BAT 
  231.     file along with a copy of CMOS.RAM in the same directory.  This program 
  232.     helps you two ways.  First, it checks two self test status functions of 
  233.     the MC146818 IC to ensure that it's data is valid and that the battery 
  234.     voltage is within the allowable limits.  If either of these checks 
  235.     fails, a warning is generated.  In theory, this should serve notice 
  236.     that the battery is on it's last legs in time to replace it.  However, 
  237.     in the real world, batteries often fail suddenly, so don't count on 
  238.     knowing in advance. 
  239.          The other function of CHEKCMOS is to make sure that the contents 
  240.     of the file CMOS.RAM match what's in the CMOS RAM itself, with the 
  241.     exception of the time and date.  This will remind you to update 
  242.     CMOS.RAM when you make a hardware change.  Also, it will absolutely 
  243.     find any CMOS RAM failures which go undetected by the IC's self test 
  244.     features. 
  245.     
  246.